$(document).ajaxSend(function(e, xhr, opt){
    var user_token = localStorage.getItem("user_token_handler");
    xhr.setRequestHeader("user_token", user_token);
});

function getUserInfo(url){
    $.ajax({
        type:"get",
        url: url,
        success: function(result){
            if(result.code == 200 && result.date!=null){
                $(".left .card h3").text(result.date.userName);
                $(".left .card a").attr("href", result.date.githubUrl);
            }
        }
    })
}

function logout(){
    localStorage.removeItem("user_token_handler");
    location.href = "blog_login.html";
}